import myaxios from './axios';  //进行了二次封装了

export const getList = (page, pageSize) => {  //分页的接口
  return myaxios.get("/pagelist", { params: { page, pageSize } })
}

export const loginReq = (values) => {
  return myaxios({
    url: '/login',
    method: 'POST',
    data: values
  })
}

export const registerReq = (values) => {
  return myaxios({
    url: '/register',
    method: 'POST',
    data: values
  })
}

export const pubReq = (data) => {
  return myaxios({
    url: '/pub',
    method: 'POST',
    data
  })
}

export const deleteReq = (data) => {
  return myaxios({
    url: '/delete-blog',
    method: 'POST',
    data
  })
}

// 点赞
export const supportReq = (data) => {
  return myaxios({
    url: '/support-blog',
    method: 'POST',
    data
  })
}

// 收藏
export const collectReq = (data) => {
  return myaxios({
    url: '/collect-user',
    method: 'POST',
    data
  })
}

export const detailsReq = (data) => {
  return myaxios({
    url: '/details-blog',
    method: 'POST',
    data
  })
}

export const quitReq = () => {
  return myaxios({
    url: '/quit',
    method: 'POST'
  })
}

export const allArticleReq = () => {
  return myaxios({
    url: '/all-article',
    method: 'POST'
  })
}
export const commentReq = (data) => {
  return myaxios({
    url: '/comment-blog',
    method: 'POST',
    data
  })
}

export const uploadReq = (data) => {
  return myaxios.post("/upload", data)
}

export const modifyPwdReq = (data) => {
  return myaxios.post("/modify-pwd", data)
}

export const getUserReq = () => {
  return myaxios.post("/user")
}
